<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
	xmlns:wsx="http://www.webservicex.net"
	xmlns:xlink="http://www.w3.org/1999/xlink"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:f="livcos.org/ns/xslt/function"
	exclude-result-prefixes="soap wsx f xs">

	<xsl:import href="base.xsl" />
	
	<xsl:template match="/">
		<xsl:variable name="url" select="'http://www.webservicex.net/WeatherForecast.asmx'"/>
		<xsl:variable name="action" select="'http://www.webservicex.net/GetWeatherByPlaceName'"/>
		<xsl:variable name="t">
			<soap:Envelope>
				<soap:Body>
					<wsx:GetWeatherByPlaceName>
						<wsx:PlaceName>NEW YORK</wsx:PlaceName>
					</wsx:GetWeatherByPlaceName>
				</soap:Body>
			</soap:Envelope>
		</xsl:variable>
		<xsl:variable name="t2">
			<soap-request action="{$action}">
				<soap:Envelope>
					<soap:Body>
						<wsx:GetWeatherByPlaceName>
							<wsx:PlaceName>NEW YORK</wsx:PlaceName>
						</wsx:GetWeatherByPlaceName>
					</soap:Body>
				</soap:Envelope>
			</soap-request>
		</xsl:variable>
		<xsl:variable name="t1">
			<http-request method="POST">
				<header name="Content-Type">text/xml; charset=utf-8</header>
				<header name="SOAPAction"><xsl:value-of select="$action"/></header>
				<body>
					<soap:Envelope action="{$action}">
						<soap:Body>
							<wsx:GetWeatherByPlaceName>
								<wsx:PlaceName>NEW YORK</wsx:PlaceName>
							</wsx:GetWeatherByPlaceName>
						</soap:Body>
					</soap:Envelope>
				</body>
			</http-request>
		</xsl:variable>
		<test>
			<xsl:copy-of select="f:request($url, $t)"/>
		</test>
	</xsl:template>
	
</xsl:stylesheet>